bin: Better handle --

We would stop passing through `--` and args after it to the underlying
command in `ostree_run`. This made it impossible to use `--` to tell the
parser that following args starting with `-` really are positional.

AFAICT, that logic for `--` here came from a time when we parse options
manually in a big loop, in which case breaking out made sense (see
97558276e4).

There's an extra step here, which is that glib by default leaves the
`--` in the list of args, so we need to take care to remove it from the
list after parsing.

Closes: #1898

Closes: #1899
Approved by: rfairley
This commit is contained in:
Jonathan Lebon authored and Atomic Bot committed 2019-08-14 12:31:10 +00:00
1 parent ab73d9f525
commit 0c48769de3
2 files changed
+19 -6

No files matched your search

+3 -1
View File
@@ -66,9 +66,11 @@ fi
assert_file_has_content err.txt "error: Too many arguments given"
echo "ok config set"
# Check that "ostree config unset" works
# Check that using `--` works and that "ostree config unset" works
${CMD_PREFIX} ostree config --repo=repo set core.lock-timeout-secs 60
assert_file_has_content repo/config "lock-timeout-secs=60"
${CMD_PREFIX} ostree config --repo=repo -- set core.lock-timeout-secs -1
assert_file_has_content repo/config "lock-timeout-secs=-1"
${CMD_PREFIX} ostree config --repo=repo unset core.lock-timeout-secs
assert_not_file_has_content repo/config "lock-timeout-secs="