Skip to content

format command-specific help - #203

Merged
jacalata merged 12 commits into
developmentfrom
jac/help-formatting
Dec 7, 2022
Merged

format command-specific help#203
jacalata merged 12 commits into
developmentfrom
jac/help-formatting

Conversation

@jacalata

Copy link
Copy Markdown
Contributor

command specific help:
c:\dev\tabcmd2>python -m tabcmd createsite -h
usage: tabcmd createsite [-h] [-s ] [-t SITEID] [--token-name | -u ]
[--token-value | -p | --password-file | --token-file ]
[--no-prompt] [-c | --no-certcheck] [--no-cookie] [-x HOST:PORT | --no-proxy]
[--timeout ] [--continue-if-exists] [--country {de,en,es,fr,it,ja,ko,pt,sv,zh}]
[--language {de,en,es,fr,it,ja,ko,pt,sv,zh}] [-l {TRACE,DEBUG,INFO,ERROR}] [-v]
[--site-id SITE_ID | -r URL] [--user-quota USER_QUOTA] [--site-mode | --no-site-mode]
[--storage-quota STORAGE_QUOTA] [--extract-encryption-mode {enforced,enabled,disabled}]
[--run-now-enabled {True,False}]
site-name

global connection arguments:
-h, --help show this help message and exit
-s , --server
Use the specified Tableau Server URL. If no protocol is specified, http:// is assumed
-t SITEID, --site SITEID
Use the specified Tableau Server site. Specify an empty string () to force use of the default site
--token-name
The name of the Tableau Server Personal Access Token. If using a token to sign in, this is required at
least once to begin session.
-u , --username
Use the specified Tableau Server user name
--token-value
Use the specified Tableau Server Personal Access Token. Requires --token-name to be set.
-p , --password
Use the specified Tableau Server password
--password-file
Read the Tableau Server password from FILE
--token-file Read the Personal Access Token from a file.
--no-prompt Do not prompt for a password
-c , --use-certificate
Use client certificate to sign in
--no-certcheck Do not validate the SSL certificate
--no-cookie Do not save the session ID when signing in. Subsequent commands will need to sign in again. If
unspecified, default is to save the session ID
-x HOST:PORT, --proxy HOST:PORT
Use the specified HTTP proxy
--no-proxy Do not use a HTTP proxy
--timeout How long to wait, in seconds, for the server to complete processing the command. The default is to
wait until the server responds

global behavioral arguments:
--continue-if-exists Treat resource conflicts as item creation success e.g project already exists
--country {de,en,es,fr,it,ja,ko,pt,sv,zh}
If not using user''s default locale, the country abbreviation for locale (find in IANA Language Subtag
Registry). Must use with --language
--language {de,en,es,fr,it,ja,ko,pt,sv,zh}
Set the language to use. Exported data will be returned in this lang/locale. If not set, the client
will use your computer locale, and the server will use your user account locale
-l {TRACE,DEBUG,INFO,ERROR}, --logging-level {TRACE,DEBUG,INFO,ERROR}
Use the specified logging level. The default level is INFO.
-v, --version Show version information and exit.

createsite:
site-name Display name of the site
--site-id SITE_ID Used in the URL to uniquely identify the site.
-r URL, --url URL Used in URLs to specify the site. Different from the site name.
--user-quota USER_QUOTA
Maximum number of users that can be added to the site.
--site-mode Allows or denies site administrators the ability to add users to or remove users from the site.
--no-site-mode Allows or denies site administrators the ability to add users to or remove users from the site.
--storage-quota STORAGE_QUOTA
In MB, the amount of data that can be stored on the site.
--extract-encryption-mode {enforced,enabled,disabled}
The extract encryption mode for the site can be enforced, enabled or disabled.
--run-now-enabled {True,False}
Allow or deny users from running extract refreshes, flows, or schedules manually.

Shouldn't be relevant except during development, but it's always nice to be accurate
- Delete help command
- Move command registration into parent_parser
- Move help output into parent_parser
- Refactor parent_parser to present args in groups for help
- Add long explanatory comment
- Extract all user facing text in parent_parser to enable translation
So that arguments for the command show up when you run tabcmd command -h
e.g
behavioral arguments:
...

listsites:
  --get-extract-encryption-mode
                        Include the extract encryption mode for each site.
@github-actions

github-actions Bot commented Nov 30, 2022

Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
tabcmd
   __main__.py888 0%
   tabcmd.py121212 0%
tabcmd/commands
   commands.py101010 0%
   constants.py591111 81%
   server.py1262525 80%
tabcmd/commands/auth
   session.py2834242 85%
tabcmd/commands/datasources_and_workbooks
   datasources_and_workbooks_command.py951919 80%
   delete_command.py601616 73%
   export_command.py1272727 79%
   get_url_command.py1534343 72%
   publish_command.py591717 71%
   runschedule_command.py2177 67%
tabcmd/commands/extracts
   create_extracts_command.py4055 88%
   decrypt_extracts_command.py2722 93%
   delete_extracts_command.py3766 84%
   encrypt_extracts_command.py2722 93%
   reencrypt_extracts_command.py2722 93%
   refresh_extracts_command.py682626 62%
tabcmd/commands/group
   create_group_command.py2955 83%
   delete_group_command.py2722 93%
tabcmd/commands/project
   create_project_command.py4699 80%
   delete_project_command.py3544 89%
   publish_samples_command.py2844 86%
tabcmd/commands/site
   create_site_command.py3677 81%
   delete_site_command.py3044 87%
   edit_site_command.py3822 95%
   list_command.py341818 47%
   list_sites_command.py3022 93%
tabcmd/commands/user
   create_site_users.py4655 89%
   create_users_command.py5244 92%
   delete_site_users_command.py4355 88%
   user_data.py2103030 86%
tabcmd/execution
   _version.py222 0%
   global_options.py1392323 83%
   localize.py6788 88%
   logger_config.py4266 86%
   parent_parser.py7733 96%
   tabcmd_controller.py3755 86%
TOTAL239342882% 

@jacalata

Copy link
Copy Markdown
Contributor Author

@dzucker-tab what do you think of the category names I made up 'global connection arguments' and 'global behavioral arguments'? Feels like there might be better ones available.

@jacalata
jacalata merged commit eafe30e into development Dec 7, 2022
jacalata added a commit that referenced this pull request Dec 8, 2022
* Add Datasources to the Get Command (#162)
* format command-specific help (#203)
* hide token-value like we do password
* Tfs 1482014 publishing (#205)
* make db-auth/oauth mutually exclusive
* Create a db credentials item for publishing with --db-username, etc arguments

Co-authored-by: Brian Cantoni <bcantoni@salesforce.com>
Co-authored-by: Bhuvnesh Singh <bhuvnesh.singh@salesforce.com>
Co-authored-by: andyoneal <andyoneal@me.com>
@jacalata
jacalata deleted the jac/help-formatting branch December 9, 2022 08:14
jacalata added a commit that referenced this pull request Dec 16, 2022
* different output based on switch used
* hide token-value like we do password
* refactoring: help command and parent_parser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants