Skip to content

Commit

Permalink
Add parser for flatpak and flatpak update
Browse files Browse the repository at this point in the history
This parser doesn’t cover all of flatpak’s subcommands because I don’t
use all of flatpak’s subcommands in my own scripts.

I created this script in order to help me test out this change:
<https://gist.github.com/Jayman2000/35a6db532e1fd718d2039c36bb25ed89>
  • Loading branch information
Jayman2000 authored and abathur committed Sep 20, 2023
1 parent 370d6f3 commit 90becc1
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions resholve
Original file line number Diff line number Diff line change
Expand Up @@ -2395,6 +2395,68 @@ class ExternalCommandParsers(object):

return (generic,)

@staticmethod
def _flatpak():
"""
Based on Flatpak v1.14.4.
"""
generic = CommandParser("flatpak")

# flatpak --help
generic.add_argument(
"-h", "--help",
"--version",
"--default-arch",
"--supported-arches",
"--gl-drivers",
"--installations",
"--print-updated-env",
"--print-system-only",
"-v", "--verbose",
"--ostree-verbose",
action="store_true"
)
subparsers = generic.add_subparsers()
# flatpak update --help
update = subparsers.add_parser("update")
update.add_argument(
"-h", "--help",
"-u", "--user",
"--system",
action="store_true"
)
update.add_argument(
"--installation",
"--arch",
"--commit",
nargs=1
)
update.add_argument(
"--force-remove",
"--no-pull",
"--no-deploy",
"--no-related",
"--no-deps",
"--no-static-deltas",
"--runtime",
"--app",
"--appstream",
action="store_true"
)
update.add_argument("--subpath", nargs=1)
update.add_argument(
"-y", "--assumeyes",
"--noninteractive",
)
update.add_argument("--sideload-repo", nargs=1)
update.add_argument(
"-v", "--verbose",
"--ostree-verbose",
action="store_true"
)

return (generic,)


def generate_builtin_command_parser(cmdname):
cmdname = "_" + cmdname
Expand Down

0 comments on commit 90becc1

Please sign in to comment.