diff --git a/_posts/2014-07-17-writting-own-completions-p1.html b/_posts/2014-07-17-writting-own-completions-p1.html index bc2a6c4..443db1e 100644 --- a/_posts/2014-07-17-writting-own-completions-p1.html +++ b/_posts/2014-07-17-writting-own-completions-p1.html @@ -68,7 +68,7 @@ esac
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: