Skip to content

Conversation

euank
Copy link
Owner

@euank euank commented Jun 10, 2018

This fixes #70.

Prior to this change, there was a mix of subcommands and flags that were
all mutually-exclusive behaviours.
This ended up being a bit awkward and made some configurations
ambiguous.

This moves to a much nicer structure. There are global flags (right now
just debug), and then there are subcommands for each distinct
mode of operation.

For ease of migration, the previous logic still remains, but it can be
safely deleted after another release or so to allow migration.

euank added 4 commits June 10, 2018 01:04
This fixes #70.

Prior to this change, there was a mix of subcommands and flags that were
all mutually-exclusive behaviors.
This ended up being a bit awkward and made some configurations
ambiguous.

This moves to a much nicer structure. There are global flags (right now
just debug), and then there are subcommands for each distinct
mode of operation.

For ease of migration, the previous logic still remains, but it can be
safely deleted after another release or so to allow migration.
This also updates the help output test for the previous commit's
changes.
Prior to this it was just 'pazi' which did so, but it's more useful in
the long run to have 'pazi' by itself print help.

This provides a migration path to that.

This also fixes a regression that would have occured if all the
deprecated code were deleted.
@euank
Copy link
Owner Author

euank commented Jun 10, 2018

After this is merged:

  • File a followup issue to delete the deprecated code
  • Make a v1.0.0 milestone and add the followup issue to it

@euank euank added this to the v0.0.3 milestone Jun 10, 2018
@euank euank requested a review from LinuxMercedes June 11, 2018 23:43
@euank euank mentioned this pull request Jun 14, 2018
This allows properly using it in the 'match' expression.
@@ -90,13 +136,18 @@ fn _main() -> PaziResult {
.long("interactive")
.short("i"),
)
// Deprecated in favor of .PaziSubcommand::Visit
// left temporarily for backwards compatibility
// Remove before 1.0
.arg(
Arg::with_name("add-dir")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be hidden as well?

.arg(
Arg::with_name("add-dir")
.help("add a directory to the frecency index")
.long("add-dir")
.takes_value(true)
.value_name("directory"),
)
// Deprecated per above deprecations
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto here for dir_target

src/main.rs Outdated
Some(to) => {
env::current_dir()
.map(|cwd| {
frecency.maybe_add_relative_to(cwd, to);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want this behavior here? It makes sense for jump (to help jumpstart (heh) a small database) but for view I'm not so sure.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just keeping the behavior it had previously since this is a refactor more than anything else.

Now that the code is split out properly, it does make sense to drop that here I think.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it doens't do save_to_disk in this function (nor did it before) so that's entirely dead code. Good catch.

euank added 2 commits July 1, 2018 19:21
It didn't actually save the change before, so this is behaviorally
identical, just deletes some pointless code.
@LinuxMercedes LinuxMercedes merged commit 0b9c23d into master Jul 2, 2018
@euank euank deleted the pr/subcmd branch July 2, 2018 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

z init doesn't work
2 participants