fix docs, completion and docker service

Signed-off-by: horpto <__Singleton__@hackerdom.ru>
This commit is contained in:
horpto 2020-08-06 17:35:27 +03:00
parent 04ab71457a
commit 0b7147a2a5
6 changed files with 12 additions and 12 deletions

View File

@ -63,7 +63,7 @@ func newLogsCommand(dockerCli command.Cli) *cobra.Command {
flags.BoolVarP(&opts.timestamps, "timestamps", "t", false, "Show timestamps")
flags.BoolVar(&opts.details, "details", false, "Show extra details provided to logs")
flags.SetAnnotation("details", "version", []string{"1.30"})
flags.StringVar(&opts.tail, "tail", "all", "Number of lines to show from the end of the logs")
flags.StringVarP(&opts.tail, "tail", "n", "all", "Number of lines to show from the end of the logs")
return cmd
}

View File

@ -1672,17 +1672,17 @@ _docker_container_kill() {
_docker_container_logs() {
case "$prev" in
--since|--tail|--until)
--since|--tail|-n|--until)
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--details --follow -f --help --since --tail --timestamps -t --until" -- "$cur" ) )
COMPREPLY=( $( compgen -W "--details --follow -f --help --since --tail -n --timestamps -t --until" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag '--since|--tail|--until')
local counter=$(__docker_pos_first_nonflag '--since|--tail|-n|--until')
if [ "$cword" -eq "$counter" ]; then
__docker_complete_containers_all
fi
@ -3526,17 +3526,17 @@ _docker_service_inspect() {
_docker_service_logs() {
case "$prev" in
--since|--tail)
--since|--tail|-n)
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--details --follow -f --help --no-resolve --no-task-ids --no-trunc --raw --since --tail --timestamps -t" -- "$cur" ) )
COMPREPLY=( $( compgen -W "--details --follow -f --help --no-resolve --no-task-ids --no-trunc --raw --since --tail -n --timestamps -t" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag '--since|--tail')
local counter=$(__docker_pos_first_nonflag '--since|--tail|-n')
if [ "$cword" -eq "$counter" ]; then
__docker_complete_services_and_tasks
fi

View File

@ -373,7 +373,7 @@ complete -c docker -A -f -n '__fish_seen_subcommand_from logs' -s f -l follow -d
complete -c docker -A -f -n '__fish_seen_subcommand_from logs' -l help -d 'Print usage'
complete -c docker -A -f -n '__fish_seen_subcommand_from logs' -s t -l timestamps -d 'Show timestamps'
complete -c docker -A -f -n '__fish_seen_subcommand_from logs' -l since -d 'Show logs since timestamp'
complete -c docker -A -f -n '__fish_seen_subcommand_from logs' -l tail -d 'Output the specified number of lines at the end of logs (defaults to all logs)'
complete -c docker -A -f -n '__fish_seen_subcommand_from logs' -s n -l tail -d 'Output the specified number of lines at the end of logs (defaults to all logs)'
complete -c docker -A -f -n '__fish_seen_subcommand_from logs' -a '(__fish_print_docker_containers running)' -d "Container"
# network

View File

@ -792,7 +792,7 @@ __docker_container_subcommand() {
"($help -f --follow)"{-f,--follow}"[Follow log output]" \
"($help -s --since)"{-s=,--since=}"[Show logs since this timestamp]:timestamp: " \
"($help -t --timestamps)"{-t,--timestamps}"[Show timestamps]" \
"($help)--tail=[Output the last K lines]:lines:(1 10 20 50 all)" \
"($help -n --tail)"{-n=,--tail=}"[Number of lines to show from the end of the logs]:lines:(1 10 20 50 all)" \
"($help -)*:containers:__docker_complete_containers" && ret=0
;;
(ls|list)
@ -2038,7 +2038,7 @@ __docker_service_subcommand() {
"($help)--no-task-ids[Do not include task IDs]" \
"($help)--no-trunc[Do not truncate output]" \
"($help)--since=[Show logs since timestamp]:timestamp: " \
"($help)--tail=[Number of lines to show from the end of the logs]:lines:(1 10 20 50 all)" \
"($help -n --tail)"{-n=,--tail=}"[Number of lines to show from the end of the logs]:lines:(1 10 20 50 all)" \
"($help -t --timestamps)"{-t,--timestamps}"[Show timestamps]" \
"($help -)1:service:__docker_complete_services" && ret=0
;;

View File

@ -17,7 +17,7 @@ Options:
--help Print usage
--since string Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)
--until string Show logs before timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)
--tail string Number of lines to show from the end of the logs (default "all")
-n, --tail string Number of lines to show from the end of the logs (default "all")
-t, --timestamps Show timestamps
```

View File

@ -18,7 +18,7 @@ Options:
--no-task-ids Do not include task IDs in output
--no-trunc Do not truncate output
--since string Show logs since timestamp
--tail string Number of lines to show from the end of the logs (default "all")
-n, --tail string Number of lines to show from the end of the logs (default "all")
-t, --timestamps Show timestamps
```