From 7707a9b80b83a5f2771b5b5292af92c05115e7a9 Mon Sep 17 00:00:00 2001
From: arcan1s
As it was said above, there are some different ways to create these files. In particular they differ in the flag declaration and their further processing. In my case I will use _arguments
command, which require a specific format of variables: FLAG[description]:MESSAGE:ACTION
. The last two fields are not required and, as you will see below, are not needed in some cases. If you want to add two flags for an action (short and long format), then the format is a little bit complicated: {(FLAG_2)FLAG_1,(FLAG_1)FLAG_2}[description]:MESSAGE:ACTION
. It should be noted that if you want to create completions for two flags but some flags have not a second format. you will should to add following line: {FLAG,FLAG}[description]:MESSAGE:ACTION
. MESSAGE
is a message which will be shown, ACTION
is an action whichh will be performed after this flag. In this tutorial ACTION
will be following: ->STATE
.
As it was said above, there are some different ways to create these files. In particular they differ in the flag declaration and their further processing. In my case I will use _arguments
command, which require a specific format of variables: FLAG[description]:MESSAGE:ACTION
. The last two fields are not required and, as you will see below, are not needed in some cases. If you want to add two flags for an action (short and long format), then the format is a little bit complicated: {(FLAG_2)FLAG_1,(FLAG_1)FLAG_2}[description]:MESSAGE:ACTION
. It should be noted that if you want to create completions for two flags but some flags have not a second format. you will should to add following line: {FLAG,FLAG}[description]:MESSAGE:ACTION
. MESSAGE
is a message which will be shown, ACTION
is an action which will be performed after this flag. In this tutorial ACTION
will be following: ->STATE
.
So, according to our requirements, flags declaration will be following: