Skip to content

Possible to be less verbose? Terminal detection and force interactive prompt #17

@enoryw

Description

@enoryw

Some minor issues that are somewhat related, curious if this can be improved:

  • There's currently lack of --interactive action, e.g. gtrash find --restore prompts on terminal but can only be --force when not interactive. It would be nice to have e.g. gtrash find --restore --interactive to always force interactive so that this command can be used anywhere where it must require confirmation before trashing all files. That would allow it to be safely used to replace gtrash find for convenience and simplicity.

  • The extra Found 1 trashed files. You can restore or remove PERMANENTLY these by --restore, --rm. messages at the end of outputs are a bit verbose, but expending a fork and/or binary call to silence them (e.g. gtrash find | cat) seems unnecessary. How about only include it in --verbose option or an option for --non-interactive or --list to only show file entries? Or perhaps use a file descriptor than standard output that can be redirected to /dev/null which seems a little more appropriate than detecting for terminal (which may potentially yield undesirable result).


Unrelated: It doesn't make sense to exit with return code 1 with the error gtrash: error: not found: trashed files for gtrash find when there are zero items in the trash can, right? Seems misleading--I would expect exit 0 since there's no errors and preferably no output since all trash is dealt with.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions