garden-io / garden

Automation for Kubernetes development and testing. Spin up production-like environments for development, testing, and CI on demand. Use the same configuration and workflows at every step of the process. Speed up your builds and test runs via shared result caching
https://garden.io
Mozilla Public License 2.0
3.33k stars 270 forks source link

Make global options more visible in `garden * --help` command #3139

Open thelongshanx opened 2 years ago

thelongshanx commented 2 years ago

Bug

Current Behavior

This is the output of garden deploy --help


Deploys all or specified services, taking into account service dependency order.
Also builds modules and dependencies if needed.

Optionally stays running and automatically re-builds and re-deploys services if their module source
(or their dependencies' sources) change.

Examples:

    garden deploy                      # deploy all modules in the project
    garden deploy my-service           # only deploy my-service
    garden deploy service-a,service-b  # only deploy service-a and service-b
    garden deploy --force              # force re-deploy of modules, even if they're already deployed
    garden deploy --watch              # watch for changes to code
    garden deploy --dev=my-service     # deploys all services, with dev mode enabled for my-service
    garden deploy --dev                # deploys all compatible services with dev mode enabled
    garden deploy --local=my-service   # deploys all services, with local mode enabled for my-service
    garden deploy --local              # deploys all compatible services with local mode enabled
    garden deploy --env stage          # deploy your services to an environment called stage
    garden deploy --skip service-b     # deploy all services except service-b

USAGE
  garden deploy [services] [options]

ARGUMENTS
  [services]  The name(s) of the service(s) to deploy (skip to deploy all services). Use comma as a separator to   
              specify multiple services.                                                                           
              [array:string]                                                                                       

OPTIONS
  -dev, --dev-mode                The name(s) of the service(s) to deploy with dev mode enabled. Use comma as a    
                                  separator to specify multiple services. Use * to deploy all services with dev    
                                  mode enabled. When this option is used, the command is run in watch mode (i.e.   
                                  implicitly sets the --watch/-w flag).                                            
                                  [array:string]                                                                   
  --force                         Force redeploy of service(s).                                                    
                                  [boolean]                                                                        
  --force-build                   Force rebuild of module(s).                                                      
                                  [boolean]                                                                        
  --forward                       Create port forwards and leave process running without watching for changes.     
                                  Ignored if --watch/-w flag is set or when in dev or hot-reload mode.             
                                  [boolean]                                                                        
  -hot, --hot-reload              The name(s) of the service(s) to deploy with hot reloading enabled. Use comma as 
                                  a separator to specify multiple services. Use * to deploy all services with hot  
                                  reloading enabled (ignores services belonging to modules that don't support or   
                                  haven't configured hot reloading). When this option is used, the command is run  
                                  in watch mode (i.e. implicitly sets the --watch/-w flag).                        
                                  [array:string]                                                                   
  -local, --local-mode            [EXPERIMENTAL] The name(s) of the service(s) to be started locally with local    
                                  mode enabled. Use comma as a separator to specify multiple services. Use * to    
                                  deploy all services with local mode enabled. When this option is used, the       
                                  command is run in persistent mode.                                               
                                  This always takes the precedence over the dev mode if there are any conflicts,   
                                  i.e. if the same services are passed to both `--dev` and `--local` options.      
                                  [array:string]                                                                   
  --skip                          The name(s) of services you'd like to skip when deploying.                       
                                  [array:string]                                                                   
  -no-deps, --skip-dependencies   Deploy the specified services, but don't deploy any additional services that     
                                  they depend on or run any tasks that they depend on. This option can only be     
                                  used when a list of service names is passed as CLI arguments. This can be useful 
                                  e.g. when your stack has already been deployed, and you want to deploy a subset  
                                  of services in dev mode without redeploying any service dependencies that may    
                                  have changed since you last deployed.                                            
                                  [boolean]                                                                        
  -w, --watch                     Watch for changes in module(s) and auto-deploy.                                  
                                  [boolean]                                                

Expected behavior

The Options section should display all available flags, but --env is missing (all global options are missing, but this one is notable because it is listed twice in the Description Examples and is a core feature.

Reproducible example

Run garden deploy --help

Suggested solution(s)

Update the generation of the params documentation

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it hasn't had any activity in 90 days. It will be closed in 14 days if no further activity occurs (e.g. changing labels, comments, commits, etc.). Please feel free to tag a maintainer and ask them to remove the label if you think it doesn't apply. Thank you for submitting this issue and helping make Garden a better product!

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it hasn't had any activity in 90 days. It will be closed in 14 days if no further activity occurs (e.g. changing labels, comments, commits, etc.). Please feel free to tag a maintainer and ask them to remove the label if you think it doesn't apply. Thank you for submitting this issue and helping make Garden a better product!

10ko commented 7 months ago

It's possible to see all the options by running garden options. We should add this suggestion in the output of the command when using the --help flag.