Skip to content

Check args and flags for commands #117

@JinnyYi

Description

@JinnyYi

Before executing the command, it may be necessary to check args and flags. If there are illegal arguments, an error should be returned directly.

Include but not limit to the following possible checks:

  • cat, sign, tee
    • if src is a dir, cat (sign, tee): src: Is a directory should return
  • cp and move
    • if src is a dir, --recursive option is required
    • if there are multiple srcs, dst should be a directory
    • if src == dst, cp: 'src' and 'dst' are the same error should return (similarly, Dir(src) == dst)
    • if dst is the subdirectory of src, maybe we should reject?
  • rm
    • if src is a dir, --recursive option is required

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions