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.
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.

3 participants