Skip to content

Handle command options with `Gio.Application.add_main_option_entries`

Luo Yi requested to merge yilozt/blackbox:276-command-options-refactoring into main
  • Use Gio.Application.add_main_option_entries() to parse arguments.

  • override handle_local_options() to show information, to make sure -v works in flatpak environment.

  • override local_command_line() to check '--' option.

  • disable the flatpak session-bus permission, ref the guide line: https://docs.flatpak.org/en/latest/sandbox-permissions.html#d-bus-access

    Access to the entire bus with --socket=system-bus or --socket=session-bus should be avoided, unless the application is a development tool.

  • Implement the --tab option and handle multiple commands from options.

Improves !118 (merged)

Closes #276

Implements #206

Screenshot

Open multiple commands without a new tab:

录屏_2023-07-18_04-06-43

Open multiple commands with a new tab:

录屏_2023-07-18_04-58-47

Edited by Luo Yi

Merge request reports