Skip to content

Conversation

@emmanuel-quevillon-outscale
Copy link
Contributor

@emmanuel-quevillon-outscale emmanuel-quevillon-outscale commented Sep 15, 2025

It solve also option precedence when using both options on the command line as shown below:

➜  oks-cli cluster list --plain --msword
|          NAME         |    CREATED    |    UPDATED    |   STATUS   | DEFAULT |
| clusterapi-management |  11 days ago  |  11 days ago  |   ready    |         |
|   anotherclusterapi   |   2 days ago  |   2 days ago  |   ready    |         |

~/work/src/oks-stuffs/cluster-api via 🐍 v3.13.5 (.venv-oks-cli)
➜  oks-cli cluster list --msword --plain
|          NAME         |    CREATED    |    UPDATED    |   STATUS   | DEFAULT |
| clusterapi-management |  11 days ago  |  11 days ago  |   ready    |         |
|   anotherclusterapi   |   2 days ago  |   2 days ago  |   ready    |         |

As shown and based on the conditions in the code, it's always --msword option that wins. Introducing --style option, this behaviour won't happen anymore.
Style --msword and --plain options are supported, but deprecated with a Warning message as shown below:

 ➜  oks-cli cluster list --plain 
DeprecationWarning: The option 'plain' is deprecated. Use --style instead
+-----------------------+---------------+---------------+------------+---------+
|          NAME         |    CREATED    |    UPDATED    |   STATUS   | DEFAULT |
+-----------------------+---------------+---------------+------------+---------+
| clusterapi-management |  11 days ago  |  11 days ago  |   ready    |         |
|   anotherclusterapi   |   3 days ago  |   3 days ago  |   ready    |         |
+-----------------------+---------------+---------------+------------+---------+

➜  oks-cli cluster list --msword      
DeprecationWarning: The option 'msword' is deprecated. Use --style instead
|          NAME         |    CREATED    |    UPDATED    |   STATUS   | DEFAULT |
| clusterapi-management |  11 days ago  |  11 days ago  |   ready    |         |
|   anotherclusterapi   |   3 days ago  |   3 days ago  |   ready    |         |

➜  oks-cli cluster list --style plain   
         NAME                   CREATED              UPDATED             STATUS          DEFAULT        
clusterapi-management         11 days ago          11 days ago           ready                          
  anotherclusterapi            3 days ago           3 days ago           ready                    

➜  oks-cli cluster list --style msword
|          NAME         |    CREATED    |    UPDATED    |   STATUS   | DEFAULT |
| clusterapi-management |  11 days ago  |  11 days ago  |   ready    |         |
|   anotherclusterapi   |   3 days ago  |   3 days ago  |   ready    |         |

In the case of multiple time option --style, the last one is considered

➜  oks-cli cluster list --style msword --style plain --style msword
|          NAME         |    CREATED    |    UPDATED    |   STATUS   | DEFAULT |
| clusterapi-management |  11 days ago  |  11 days ago  |   ready    |         |
|   anotherclusterapi   |   3 days ago  |   3 days ago  |   ready    |         |

…sword,plain]. This allow to easily add new sytle if needed.

It solve also option precedence when using both option on the command line. See PR message.
@horkko
Copy link

horkko commented Nov 14, 2025

Any chance someone can review it?

@outscale-ykr
Copy link
Contributor

hi @horkko we cannot merge this as a minor version because it changes interaction with flags, and could break existing automation and scripts that rely on oks-cli

@horkko
Copy link

horkko commented Nov 17, 2025

Hi @outscale-ykr
It's me, Emmanuel ;) I've used my public account to add the comment.
The PR supports both the new and old options if I remember correctly. It only prints a deprecation warning when old option is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants