<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-live-build.git/functions/arguments.sh, branch rolling</title>
<subtitle> (mirror of https://github.com/vyos/vyos-live-build.git)
</subtitle>
<id>https://git.amelek.net/vyos/vyos-live-build.git/atom?h=rolling</id>
<link rel='self' href='https://git.amelek.net/vyos/vyos-live-build.git/atom?h=rolling'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/'/>
<updated>2020-05-03T00:38:17+00:00</updated>
<entry>
<title>fix usage/help/man bugs</title>
<updated>2020-05-03T00:38:17+00:00</updated>
<author>
<name>Lyndon Brown</name>
<email>jnqnfe@gmail.com</email>
</author>
<published>2020-05-03T00:25:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=7276d0213fd26ee68b62b84080261e29512871e9'/>
<id>urn:sha1:7276d0213fd26ee68b62b84080261e29512871e9</id>
<content type='text'>
 - the definition of $PROGRAM as used in $USAGE strings defined in each
   script has been broken for a long time, being simply "lb" when it needs
   to be "lb COMMAND".
 - `config` changed $PROGRAM to "lb config" thus its output was correct in
   this regard unlike everything else, but with the switch to a more
   "intelligent" `Man()` function recently, it means that instead of
   `man lb config`, what was actually run was `man lb config config`,
   which displayed the manpage, then on exiting with `q`, it showed some
   sort of index line todo with a "config" search (no exact manpage
   match?), for which you had to enter `ctrl+c` to get rid of.

this revises things to fix the issues, minimising change by changing
$PROGRAM to "lb COMMAND", with the frontend overriding this.

Gbp-Dch: Ignore
</content>
</entry>
<entry>
<title>args: restore a little tidying</title>
<updated>2020-05-03T00:31:47+00:00</updated>
<author>
<name>Lyndon Brown</name>
<email>jnqnfe@gmail.com</email>
</author>
<published>2020-05-02T23:38:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=372a8fd91a9ec22c22250e4a0322432305b69a9f'/>
<id>urn:sha1:372a8fd91a9ec22c22250e4a0322432305b69a9f</id>
<content type='text'>
lost in a reversion

Gbp-Dch: Ignore
</content>
</entry>
<entry>
<title>options: de-duplicate common option handling</title>
<updated>2020-05-02T17:18:49+00:00</updated>
<author>
<name>Lyndon Brown</name>
<email>jnqnfe@gmail.com</email>
</author>
<published>2020-05-02T17:18:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=22d8ac15dbc75af2acf02447cf045791b137d7d4'/>
<id>urn:sha1:22d8ac15dbc75af2acf02447cf045791b137d7d4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Revert "frontend: properly handle option processing"</title>
<updated>2020-04-24T13:37:13+00:00</updated>
<author>
<name>Raphaël Hertzog</name>
<email>raphael@offensive-security.com</email>
</author>
<published>2020-04-23T20:17:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=104fa2039990f17e02dd9d2dbfc801763987b532'/>
<id>urn:sha1:104fa2039990f17e02dd9d2dbfc801763987b532</id>
<content type='text'>
This reverts commit 6b7c8ed4bf15175299729355f04d60dcbac1aded as it's
breaking multi-value space-separated parameters.
</content>
</entry>
<entry>
<title>Use descriptive parameter names for Usage()</title>
<updated>2020-04-23T14:38:59+00:00</updated>
<author>
<name>Raphaël Hertzog</name>
<email>hertzog@debian.org</email>
</author>
<published>2020-04-23T14:38:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=4c75f80e6763490d5bcb0e0a460b096a3292ae61'/>
<id>urn:sha1:4c75f80e6763490d5bcb0e0a460b096a3292ae61</id>
<content type='text'>
</content>
</entry>
<entry>
<title>usage: take exit code as param</title>
<updated>2020-04-23T14:32:26+00:00</updated>
<author>
<name>Lyndon Brown</name>
<email>jnqnfe@gmail.com</email>
</author>
<published>2020-03-30T16:32:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=b3bba232ac6e1feff9e506506247aa20cd7f467c'/>
<id>urn:sha1:b3bba232ac6e1feff9e506506247aa20cd7f467c</id>
<content type='text'>
thus it can correctly indicate success/fail status instead of always
indicating failure. when a user asks for usage with -u|--usage then we
should exit in success mode rather than failure as when usage in printed
in response to incorrect usage.

Gbp-Dch: Short
</content>
</entry>
<entry>
<title>frontend: properly handle option processing</title>
<updated>2020-04-23T14:29:00+00:00</updated>
<author>
<name>Lyndon Brown</name>
<email>jnqnfe@gmail.com</email>
</author>
<published>2020-03-18T01:51:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=6b7c8ed4bf15175299729355f04d60dcbac1aded'/>
<id>urn:sha1:6b7c8ed4bf15175299729355f04d60dcbac1aded</id>
<content type='text'>
this means that the usage goes from:
 lb {-h|--help|-u|--usage|-v|--version}
 lb COMMAND [OPTIONS]

to:
 lb {-h|--help|-u|--usage|-v|--version}
 lb [FRONTEND_OPTIONS] COMMAND [COMMAND_OPTIONS]

though it is probably not worth is to update the description in the
manpages...? hmm...

so for instance this matters for color control with --color|--no-color
(you already had full control via environment vars). previously you could
do `lb COMMAND --no-color` to turn off colour, only to find that output
at the frontend level was still coloured (the option is processed at the
command context level, not the frontend), so you might try to instead use
`lb --no-color COMMAND`, only to find that this was not supported. Well
now it is, and used at the frontend level will fully control colour output
(after the command is processed anyway).

the full set of common options are thus available (except --force) at the
frontend level, and thus for instance all Echo_*() helpers used in the
frontend will work correctly after args are processed.

furthermore usage like `lb --color --help` will actually work. (not that
color is used there, but this previously would have failed with the
frontend treating the `--color` argument as the command; that's the point!)

Gbp-Dch: Short
</content>
</entry>
<entry>
<title>fix incorrect handling of -c|--conffile</title>
<updated>2020-04-23T10:52:13+00:00</updated>
<author>
<name>Lyndon Brown</name>
<email>jnqnfe@gmail.com</email>
</author>
<published>2020-03-30T05:41:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=6b734df9f32914049b9a6e2291bda5c5b133b4bb'/>
<id>urn:sha1:6b734df9f32914049b9a6e2291bda5c5b133b4bb</id>
<content type='text'>
this option actually only has an impact when used for `lb config`; it thus
was incorrectly accepted and captured by Arguments() and the documentation
was wrong.

going back through git history, this has been incorrect since the v0.99 days.

also, reorganised the list alphabetically (no-color was inserted in the
wrong place).

Gbp-Dch: Short
</content>
</entry>
<entry>
<title>args: fix a typo</title>
<updated>2020-03-23T08:06:51+00:00</updated>
<author>
<name>Lyndon Brown</name>
<email>jnqnfe@gmail.com</email>
</author>
<published>2020-03-18T01:09:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=85e0681ee88a293e35bd77e613010663f274ece5'/>
<id>urn:sha1:85e0681ee88a293e35bd77e613010663f274ece5</id>
<content type='text'>
Gbp-Dch: Ignore
</content>
</entry>
<entry>
<title>use local scope for private function vars</title>
<updated>2020-03-16T22:10:03+00:00</updated>
<author>
<name>Lyndon Brown</name>
<email>jnqnfe@gmail.com</email>
</author>
<published>2020-02-20T06:58:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=c55eb8a0c3ca5b8ed1081e7eb8a423563288fb58'/>
<id>urn:sha1:c55eb8a0c3ca5b8ed1081e7eb8a423563288fb58</id>
<content type='text'>
all vars affected have been carefully checked to be quite certain
that they are definitely local

where variable is assigned the return value of a function/command, the
local "declaration" is deliberately done on a separate line, since
`local FOO` is actually treated itself as a command rather than a
declaration; will thus always cause $? to be zero, and thus if done on
the same line as such an assignment can not only clobber $? but in doing
so unintentionally blocks failure of a command from triggering the
expected exit from having `set -e`.

also, from testing, i have found that when assigning "${@}" this must be
done on a separate line confusingly as otherwise an error occurs.

Gbp-Dch: Short
</content>
</entry>
</feed>
