Repository navigation
Deploy: correctness, HISTTIMEFORMAT, dedup, refactor, and bug fixes - #5
Merged
Merged
Conversation
Remove unused `default_history_path_for` export and add `BashHistoryParser` type alias for naming consistency. Implement `parse_with_detected` function that detects shell format and dispatches to the appropriate parser.
Update `default_history_path` to return `Option<PathBuf>` instead of panicking when `HOME` is unset. Change `home_dir` to return `Option<PathBuf>` accordingly. Delegate zsh extended history detection to the parser module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Deploys 17 commits from
versionFtomastercovering all gap-analysis remediation work.Phases
--grep, date validation via civil round-trip (rejects Feb 30 etc.),home_dir()returnsOptioninstead of panicking,load_history_fileacceptsAsRef<Path>,--since/--untilno-timestamp hint,--helpstdout (not stderr), UTC bucketing noted in docs.DefaultHistoryParsernow detects#<digits>lines and attaches timestamps to the following command. 4 new tests.bar_len/BAR_MAXinoutput/mod.rs; zsh prefix detection delegates toparse_zsh_extended; fish- cmd:/cmd:collapsed; removed redundantHistoryEntry::from_partsanddefault_history_path_for.BashHistoryParsertype alias; unified--no-default-ignorewording; reorderedcompletions.rsFLAGS to match help;count_commands_at_depthfast path reusesentry.commandfor depth=1.--grepis case-insensitive;--trend-bucketdaily|weekly|monthlyaliases documented; misleadingdate.rstest comment fixed.run()split intoexecute()+core_pipeline()for testability; completions doc comment updated to drop the false "kept in sync" claim.parse_with_detected()convenience function that auto-detects shell format and parses, with a doc test.Bug fixes found during real-data testing
\\n— multi-line fish commands stored newlines as\nescapes; the parser treated them as literal text, producing phantom commands like\nmv. Addedunescape_fish()(\\\\\→\\\\,\\n→ newline). 2 new tests.--since/--until/--trendempty cases printed both a specific message AND the generic "no commands to show from {source}". Fixedcore_pipelineto returnwas_empty = falsewhen a specific message was already printed.Verification
~/.bash_history,~/.local/share/fish/fish_historywith 2000+ entries): default run,--depth 2,--grep,--json,--csv,--stats,--trend(day/week/month),--since/--until,--output,--man,--completions, stdin pipe, unknown flag, bad date, bad regex.mvcorrectly shows count 5 (was scattered as\nmvphantoms); date/trend empty cases print exactly one message.Commits (17)