You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The initial implementation of the push and pull commands supports pass-through of boolean commands.
Would be nice to also add support for passing through aws s3 sync command flags that accept values, in particular --include and --exclude.
A convention for passing in sync flags is required because their native format (using leading double dashes such as in --delete) causes errors in argparse at the datakit layer, which interprets such commands as missing arguments for its own parser.
A proposed syntax for pass-through arguments is below.
Implementation
Will likely need a custom argument parser class to properly parse and escape incoming command-line arguments, based on our custom convention (see below).
The argparser for the datakit-data commands (push and pull) will use the argparse.REMAINDER strategy, as below, to gather all pass-through flags:
classPush(ProjectMixin, CommandHelpers, Command):
"Push local data to S3"defget_parser(self, prog_name):
parser=super(Push, self).get_parser(prog_name)
parser.add_argument('args', nargs=argparse.REMAINDER)
returnparser
Custom pass-through args syntax
Below is a first pass at syntax for passing through cli flags for the aws s3 sync command. Basically, it involves:
dropping the leading -- on boolean arguments
for args that accept values, using an = sign to separate flag from values (This will require some careful handling in the arg parser because the --grants flag accepts values that include the equals sign
for args that accept multiple values, use commas to separate the values (--grants is potentially multivalue option)
We'll need to ensure proper escaping/handling of matching patterns for --include and --exclude
- Sub spaces for colons in command entry_points
- Update docs to reflect removal of colons from command names
- Update tests to reflect removal of colons from command names
- Bump plugin version to 0.2.0
The initial implementation of the
push
andpull
commands supports pass-through of boolean commands.Would be nice to also add support for passing through aws s3 sync command flags that accept values, in particular
--include
and--exclude
.A convention for passing in
sync
flags is required because their native format (using leading double dashes such as in--delete
) causes errors in argparse at thedatakit
layer, which interprets such commands as missing arguments for its own parser.Implementation
Will likely need a custom argument parser class to properly parse and escape incoming command-line arguments, based on our custom convention (see below).
The argparser for the
datakit-data
commands (push
andpull
) will use theargparse.REMAINDER
strategy, as below, to gather all pass-through flags:Custom pass-through args syntax
Below is a first pass at syntax for passing through cli flags for the
aws s3 sync
command. Basically, it involves:--
on boolean arguments=
sign to separate flag from values (This will require some careful handling in the arg parser because the--grants
flag accepts values that include the equals sign--grants
is potentially multivalue option)The text was updated successfully, but these errors were encountered: