[lxc/lxc] 424646: Fill missing commands on name completion.

0 views
Skip to first unread message

Stéphane Graber

unread,
Sep 14, 2021, 11:34:10 PM (4 days ago) Sep 14
to lxc-...@lists.linuxcontainers.org
Branch: refs/heads/master
Home: https://github.com/lxc/lxc
Commit: 4246469f8bfdfaa62cfe8c6f952e1cfcb7e3143d
https://github.com/lxc/lxc/commit/4246469f8bfdfaa62cfe8c6f952e1cfcb7e3143d
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-06 (Mon, 06 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Fill missing commands on name completion.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: 2173e808ca7205afdc94d324348484e6e8327383
https://github.com/lxc/lxc/commit/2173e808ca7205afdc94d324348484e6e8327383
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-06 (Mon, 06 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Use `--running` instead of `--active`.

Commands block if container is frozen.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: db8b9df55517b5bdf2ff4d450238de6234eb2c16
https://github.com/lxc/lxc/commit/db8b9df55517b5bdf2ff4d450238de6234eb2c16
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-06 (Mon, 06 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Add `compopt` call to `__lxc_piped_args`.

On pair with how other functions do it. Also, be smarter about adding
whitespace when there are no more completions available for the
parameter.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: 8aa4490505f9ad5a957f3f9797a9ccc080d3bb5d
https://github.com/lxc/lxc/commit/8aa4490505f9ad5a957f3f9797a9ccc080d3bb5d
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-06 (Mon, 06 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Improve name completion handling.

Use regex to handle short option `-n`, since short options can be
combined (e.g. `-nd`) as long as at max one requires an argument.

Also consider the case when the arg for the long option is not given
together with `--name=`.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: 8e4c68e67aceaa83852675b91be083023a60e0b8
https://github.com/lxc/lxc/commit/8e4c68e67aceaa83852675b91be083023a60e0b8
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-06 (Mon, 06 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Add completion output for `lxc-ls --fancy-format`.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: 6139460643411cf6876c90ca0075fabf330d89c8
https://github.com/lxc/lxc/commit/6139460643411cf6876c90ca0075fabf330d89c8
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-06 (Mon, 06 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Add support for container composed names.

When a container name has whitespace in it
(e.g. created by `lxc-create -t download -n "arch linux"` ),
the completion for other commands should be able to work by adding a
backslash to escape it.

Although it may be interesting to support names between quotes, this
would probably means to have to add quotes to all names. Might not be
interesting just due to an edge case.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: 8617586740a24750e39c97e64952a36248d4cbdf
https://github.com/lxc/lxc/commit/8617586740a24750e39c97e64952a36248d4cbdf
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-07 (Tue, 07 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Use more bash-like syntax.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: 53431db9448bc13129613571f89951b3a917315b
https://github.com/lxc/lxc/commit/53431db9448bc13129613571f89951b3a917315b
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-07 (Tue, 07 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Fix `lxc-snapshot` completion.

For options `-r,--restore` and `-d,--destroy`, we need the container
name to create the list of completion values.

Therefore, it is needed to scan the current command line to check if
there is a container name available.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: 66e8c08985a05692fd176216159223b80744ec29
https://github.com/lxc/lxc/commit/66e8c08985a05692fd176216159223b80744ec29
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-07 (Tue, 07 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Refactor `__lxc_piped_args`.

Use bash functions for common array operations. Keep code logic somewhat
easy to read for bug hunting.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: d72a39a52892719d150c957b2ce6040ca94db465
https://github.com/lxc/lxc/commit/d72a39a52892719d150c957b2ce6040ca94db465
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-07 (Tue, 07 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Add support for comma as a completion word.

For `lxc-ls --groups` and `lxc-autostart --groups`.
Support leading comma, trailing comma, embedded double comma.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: b73b4ec7fb1cbad4493f4aa375b574a2c5cbe7e2
https://github.com/lxc/lxc/commit/b73b4ec7fb1cbad4493f4aa375b574a2c5cbe7e2
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-07 (Tue, 07 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Fix `lxc-create` completion.

Do not append a name of an existing container.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: f73bcca529a3759f9dfb7f6d0985db9fe7f33f27
https://github.com/lxc/lxc/commit/f73bcca529a3759f9dfb7f6d0985db9fe7f33f27
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-07 (Tue, 07 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Another round of more bash-like syntax.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: 4cd0915e76bf4cce366474109c7e17e9beb2d1eb
https://github.com/lxc/lxc/commit/4cd0915e76bf4cce366474109c7e17e9beb2d1eb
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-07 (Tue, 07 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Refactor `__lxc_groups()` to `__lxc_get_groups()`.

Make code logic be more clear to what it is being done.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: a33d86d20b041a469c4e6ed437969a0a1c791fc4
https://github.com/lxc/lxc/commit/a33d86d20b041a469c4e6ed437969a0a1c791fc4
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-07 (Tue, 07 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Add `__lxc_get_selinux_contexts()`.

List SElinux contexts available. Not clear if this could be only for
root or if normal user with `sudo` is also supported.

Using `Fedora34` for basic testing.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: 2b86aa4c231134955553a82f1158b9f3d90949fa
https://github.com/lxc/lxc/commit/2b86aa4c231134955553a82f1158b9f3d90949fa
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-07 (Tue, 07 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Add completion for `lxc-copy` param `--fssize`.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: d36b3a3a9a5971da0cbfaba8feb6d83a43eb3644
https://github.com/lxc/lxc/commit/d36b3a3a9a5971da0cbfaba8feb6d83a43eb3644
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-07 (Tue, 07 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Update `_lxc_usernsexec`.

Not really much can be done for this function, as `-m` requires an ID
mapping that has to be manually input, since it will use
`/etc/sub{g,u}id` if not specified.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: 83ca245532c6540a66ed0c265b9d270b220c58bc
https://github.com/lxc/lxc/commit/83ca245532c6540a66ed0c265b9d270b220c58bc
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-07 (Tue, 07 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Add `__lxc_cgroup_state_object()`.

Support cgroup state-object completion values for `lxc-cgroup`.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: c2274666731a72cfe3e5796e7d7fb8f1e418001d
https://github.com/lxc/lxc/commit/c2274666731a72cfe3e5796e7d7fb8f1e418001d
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-07 (Tue, 07 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Check completion for prefixes names.

If a name is a prefix of another word available for completion, adjust
to show all words with given prefix.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: b3dcb194074e88b7eb743fdc7743b2a6de1cdef0
https://github.com/lxc/lxc/commit/b3dcb194074e88b7eb743fdc7743b2a6de1cdef0
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-07 (Tue, 07 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Refactor ` __lxc_check_name_present()`.

Print name of container found, if any.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: d9be2feb09ab2a37bde5ec5fe9a3fd7e8e1bff3a
https://github.com/lxc/lxc/commit/d9be2feb09ab2a37bde5ec5fe9a3fd7e8e1bff3a
Author: Edênis Freindorfer Azevedo <eden...@gmail.com>
Date: 2021-09-08 (Wed, 08 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Fix `lxc-cgroup` smart completion.

Also make bash function more readable for itself.

Signed-off-by: Edênis Freindorfer Azevedo <eden...@gmail.com>


Commit: e75839906730bcacff7c08a444130bd1679dd233
https://github.com/lxc/lxc/commit/e75839906730bcacff7c08a444130bd1679dd233
Author: Stéphane Graber <stgr...@ubuntu.com>
Date: 2021-09-14 (Tue, 14 Sep 2021)

Changed paths:
M config/bash/lxc.in

Log Message:
-----------
Merge pull request #3966 from denisfa/improve-bash-completion-ext

Improve bash completion - part 2.


Compare: https://github.com/lxc/lxc/compare/99858040666b...e75839906730
Reply all
Reply to author
Forward
0 new messages