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

Fix help output formatting and update XML example #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

oyarsa
Copy link

@oyarsa oyarsa commented Jan 9, 2025

The current help text has two issues:

  • The format for the Claude XML is out of sync with the code. I copied the example from the README.md.
  • Added \b to the example sections. Without it, click doesn't respect line breaks. With it, it keeps the line breaks as-is.

Output after changes:

Usage: files-to-prompt [OPTIONS] [PATHS]...

  Takes one or more paths to files or directories and outputs every file,
  recursively, each one preceded with its filename like this:

  path/to/file.py
  ----
  Contents of file.py goes here

  ---
  path/to/file2.py
  ---
  ...

  If the `--cxml` flag is provided, the output will be structured as follows:

  <documents>
  <document index="1">
  <source>my_directory/file1.txt</source>
  <document_content>
  Contents of file1.txt
  </document_content>
  </document>
  <document index="2">
  <source>my_directory/file2.txt</source>
  <document_content>
  Contents of file2.txt
  </document_content>
  </document>
  </documents>

Options:
  -e, --extension TEXT
  --include-hidden      Include files and folders starting with .
  --ignore-gitignore    Ignore .gitignore files and include all files
  --ignore TEXT         List of patterns to ignore
  -o, --output PATH     Output to a file instead of stdout
  -c, --cxml            Output in XML-ish format suitable for Claude's long
                        context window.
  --version             Show the version and exit.
  --help                Show this message and exit.

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.

1 participant