这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@michaelshobbs
Copy link
Member

Example with plugin that has not updated its help output:

# dokku
Usage: dokku [--quiet|--trace|--rm-container|--rm|--force] COMMAND <app> [command-specific-options]

Options:
    apps:create <app>                                                                                                    Create a new app
    apps:destroy <app>                                                                                                   Permanently destroy an app
    apps                                                                                                                 List your apps
    backup:export [file]                                                                                                 Export dokku configuration files
    backup:import [file]                                                                                                 Import dokku configuration files
    config (<app>|--global)                                                                                              Display all global or app-specific config vars
    config:get (<app>|--global) KEY                                                                                      Display a global or app-specific config value
    config:set (<app>|--global) KEY1=VALUE1 [KEY2=VALUE2 ...]                                                            Set one or more config vars
    config:unset (<app>|--global) KEY1 [KEY2 ...]                                                                        Unset one or more config vars
    docker-options:add <app> <phase(s)> OPTION                                                                           Add docker option to app for phase (comma seperated phase list)
    docker-options <app>                                                                                                 Display apps docker options for all phases
    docker-options <app> <phase(s)>                                                                                      Display apps docker options for phase (comma seperated phase list)
    docker-options:remove <app> <phase(s)> OPTION                                                                        Remove docker option from app for phase (comma seperated phase list)
    domains:add <app> DOMAIN                                                                                             Add a custom domain to app
    domains <app>                                                                                                        List custom domains for app
    domains:clear <app>                                                                                                  Clear all custom domains for app
    domains:remove <app> DOMAIN                                                                                          Remove a custom domain from app
    events:list                                                                                                          List logged events
    events:off                                                                                                           Disable events logger
    events:on                                                                                                            Enable events logger
    events [-t]                                                                                                          Show the last events (-t follows)
    help                                                                                                                 Print the list of commands
    hostkeys:app:add <app>                          Add a app-specific hostkey
    hostkeys:app:autoadd <app> <hostname>           Automatically add hostkeys for a given host to the shared hostkeys
    hostkeys:app:delete <app>                       Deletes all app-specific hostkeys
    hostkeys:app:show <app>                         Show all hostkeys for a given app
    hostkeys                                        Print an explanation (Useful to get the concept)
    hostkeys:shared:add                             Add a shared hostkey
    hostkeys:shared:autoadd <hostname>              Automatically add hostkeys for a given host to the shared hostkeys
    hostkeys:shared:delete                          Deletes all shared hostkeys
    hostkeys:shared:delete <hostname>               Deletes the shared hostkeys for the given host
    hostkeys:shared:show                            Show shared hostkeys
    logs <app> [-t]                                                                                                      Show the last logs for an application (-t follows)
    ls                                                                                                                   Pretty listing of deployed applications and containers
    nginx:build-config <app>                                                                                             (Re)builds nginx config for given app
    nginx:import-ssl <app>                                                                                               Imports a tarball from stdin; should contain server.crt and server.key
    plugins-install                                                                                                      Install active plugins
    plugins                                                                                                              Print active plugins
    plugins-update                                                                                                       Update active plugins
    ps <app>                                                                                                             List processes running in app container(s)
    ps:rebuildall                                                                                                        Rebuild all apps
    ps:rebuild <app>                                                                                                     Rebuild an app
    ps:restartall                                                                                                        Restart all deployed app containers
    ps:restart <app>                                                                                                     Restart app container(s)
    ps:scale <app> <proc>=<count> [<proc>=<count>]                                                                       Set how many instances of a given process to run
    ps:start <app>                                                                                                       Start app container(s)
    ps:stop <app>                                                                                                        Stop app container(s)
    run <app> <cmd>                                                                                                      Run a command in the environment of an application
    shell                                                                                                                Spawn dokku shell
    url <app>                                                                                                            Show the first URL for an application (compatibility)
    urls <app>                                                                                                           Show all URLs for an application
    version                                                                                                              Print dokku's version

@michaelshobbs
Copy link
Member Author

@josegonzalez you're welcome 😜

@josegonzalez
Copy link
Member

Does this break plugin help output?

@michaelshobbs
Copy link
Member Author

What do you mean? It works in my test env.

EDIT: oh you mean external plugins. yes we needed a common field delimiter to make this work.

@josegonzalez
Copy link
Member

What about a space character? And then somehow trim whitespace from the second column?

@michaelshobbs
Copy link
Member Author

There's white space throughout the entire line though....

@josegonzalez
Copy link
Member

Well won't column only take the first whitespace? Maybe something like cut would work better?

@michaelshobbs
Copy link
Member Author

if you take the following as an example, you have white space in the first section and whitespace in second section but I see no common way to delineate from line to line.

events [-t]                                  Show the last events (-t follows)
help                                           Print the list of commands
logs <app> [-t]                           Show the last logs for an application (-t follows)
ls                                               Pretty listing of deployed applications and containers
nginx:build-config <app>           (Re)builds nginx config for given app

@josegonzalez
Copy link
Member

Dammit. I guess this is a breaking change then

@michaelshobbs
Copy link
Member Author

I'll need to update docs to include this format too

@josegonzalez
Copy link
Member

Closes #1347.

@jpscharf
Copy link

This change should be BC, if the help command does not have the comma, it should just print as is:

test-dokku-help-format.sh

Input

new-help,Print the list of commands
new-plugins,Print active plugins
new-plugins-install,Install active plugins
new-plugins-update,Update active plugins
old-help                Print the list of commands
old-plugins             Print active plugins
old-plugins-install     Install active plugins
old-plugins-update      Update active plugins

Output

new-help                                            Print the list of commands
new-plugins                                         Print active plugins
new-plugins-install                                 Install active plugins
new-plugins-update                                  Update active plugins
old-help                Print the list of commands
old-plugins             Print active plugins
old-plugins-install     Install active plugins
old-plugins-update      Update active plugins

@michaelshobbs
Copy link
Member Author

@jpscharf fair point. i'll update this

@michaelshobbs michaelshobbs force-pushed the mh-columnar-help-output branch from e4ea2a7 to ab8bc99 Compare July 28, 2015 16:34
@michaelshobbs michaelshobbs force-pushed the mh-columnar-help-output branch from ab8bc99 to f752d32 Compare July 28, 2015 16:35
@michaelshobbs michaelshobbs force-pushed the mh-columnar-help-output branch from f752d32 to 36d607a Compare July 28, 2015 16:36
@michaelshobbs
Copy link
Member Author

@josegonzalez tested with a different plugin and it still works. just looks unaligned as @jpscharf showed

@josegonzalez
Copy link
Member

Are there any plugins with a comma in the definition already?

@michaelshobbs
Copy link
Member Author

That's a good question. Any suggestions on how to find this out?

@josegonzalez
Copy link
Member

Install all the plugins and type "dokku help" :P

@michaelshobbs
Copy link
Member Author

Let me know how that goes....

@josegonzalez
Copy link
Member

lmao fine merge at will

@michaelshobbs
Copy link
Member Author

Honestly, if any already do, it's just the alignment that will be off. I don't think it's a big deal.

michaelshobbs added a commit that referenced this pull request Jul 28, 2015
@michaelshobbs michaelshobbs merged commit fd3f846 into master Jul 28, 2015
@michaelshobbs michaelshobbs deleted the mh-columnar-help-output branch July 28, 2015 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants