YiNNx / cmd-wrapped

👩‍💻 A CLI Tool for Command Line Insights
https://crates.io/crates/cmd-wrapped
MIT License
970 stars 26 forks source link

Replace the naive history command parser with a comprehensive shell syntax parser #36

Open YiNNx opened 2 weeks ago

YiNNx commented 2 weeks ago

The current history commad parser in cmd-wrapped only supports basic shell syntax (e.g., pipeline |, conditional list &&, brace blocks {}, comments #, sudo, and environment variables) with a naive implementation. We need to replace it with a comprehensive shell syntax parser for better parsing results.

Two possible approaches:

  1. Import a crate like rust-shlex or conch-parser.
  2. Implement a shell syntax parser from scratch.