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

feat(dump history): You can specify the time range, regex and format to dump #374

Merged
merged 5 commits into from
Dec 3, 2023

Conversation

TD-Sky
Copy link
Contributor

@TD-Sky TD-Sky commented Sep 4, 2023

Implementation of #372.

Now you can dump the history. For example,

$ mcfly dump > history.json

will dump the whole history into json file.

Here are the options:

      --since <SINCE>    Select all commands ran since the point
      --before <BEFORE>  Select all commands ran before the point
  -s, --sort <ORDER>     Sort order [case ignored] [default: ASC] [possible values: ASC, DESC]
  -r, --regex <REGEX>    Require commands to match the pattern
  -f, --format <FORMAT>  The format to dump in [default: json] [possible values: json, csv]
  -h, --help             Print help

The timestamp (since/before) format is subject to chrono-systemd-time which is a non-strict implementation of systemd.time.


I think the PR isn't in the final stage now so suggestions are welcome.

@cantino
Copy link
Owner

cantino commented Sep 5, 2023

Awesome, I'll test this out shortly. Thanks @TD-Sky

@cantino
Copy link
Owner

cantino commented Sep 7, 2023

@TD-Sky would you be able to also update the mcfly help dump page and README with example usage and especially a timestamp example or format reference?

@TD-Sky
Copy link
Contributor Author

TD-Sky commented Sep 8, 2023

Let me have a try.

@TD-Sky
Copy link
Contributor Author

TD-Sky commented Sep 12, 2023

You could review README.md now.

Sorry for my delay, I'm busy these days.

@Houlistonm
Copy link

Any plans to merge?

@TD-Sky
Copy link
Contributor Author

TD-Sky commented Nov 15, 2023

Any plans to merge?

chrono depreciated some APIs we are using. I may need to refactor chrono-systemd-time to adapt the correct APIs.

@TD-Sky
Copy link
Contributor Author

TD-Sky commented Nov 16, 2023

Fixed.

@cantino cantino merged commit e7f241e into cantino:master Dec 3, 2023
27 checks passed
@cantino
Copy link
Owner

cantino commented Dec 3, 2023

Thank you @TD-Sky for this nice addition!

@cantino
Copy link
Owner

cantino commented Dec 3, 2023

Released https://github.com/cantino/mcfly/releases/tag/v0.8.3

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.

3 participants