Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move --quiet option to CLI_JSON #50

Closed
hkoba opened this issue Sep 17, 2018 · 0 comments

Comments

@hkoba
Copy link
Owner

commented Sep 17, 2018

Benefit

  • Usage output from default cmd_help becomes shorter.
  • ...::CLI becomes purer interface for ...::CLI_JSON.

Migration advice

If you rely on --quiet option of old ...::CLI, please define derived class
of ...::CLI and use it instead.

Here is an example.

  1. Declare quiet option like [fields => qw/quiet/] or so.
  2. Define cli_output method.
package MyCLI;
use MOP4Import::Base::CLI -as_base
  , [fields => qw/quiet/];
use MOP4Import::Util qw/terse_dump/;

sub cli_output {
  (my MY $self, my $res) = @_;
  return if $self->{quiet};
  print join("\n", map {terse_dump($_)} @$res), "\n";
}
1;

@hkoba hkoba added the api-change label Sep 17, 2018

@hkoba hkoba self-assigned this Sep 17, 2018

hkoba added a commit that referenced this issue Sep 17, 2018

@hkoba hkoba closed this Oct 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.