mirror of
https://github.com/kirill-markin/repo-to-text.git
synced 2025-12-05 19:12:24 -08:00
Accept input directory as first parameter, default to .
Related to #7 --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/kirill-markin/repo-to-text/issues/7?shareId=XXXX-XXXX-XXXX-XXXX).
This commit is contained in:
parent
ad36a75a7a
commit
9847e1ff46
2 changed files with 8 additions and 1 deletions
|
|
@ -76,6 +76,12 @@ You can customize the behavior of `repo-to-text` with the following options:
|
|||
repo-to-text --debug > debug_log.txt 2>&1
|
||||
```
|
||||
|
||||
- `input_dir`: Specify the directory to process. If not provided, the current directory (`.`) will be used. For example:
|
||||
|
||||
```bash
|
||||
repo-to-text /path/to/input_dir
|
||||
```
|
||||
|
||||
## Settings
|
||||
|
||||
`repo-to-text` also supports configuration via a `.repo-to-text-settings.yaml` file. By default, the tool works without this file, but you can use it to customize what gets included in the final text file.
|
||||
|
|
|
|||
|
|
@ -254,6 +254,7 @@ def create_default_settings_file():
|
|||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='Convert repository structure and contents to text')
|
||||
parser.add_argument('input_dir', nargs='?', default='.', help='Directory to process') # P3e87
|
||||
parser.add_argument('--debug', action='store_true', help='Enable debug logging')
|
||||
parser.add_argument('--output-dir', type=str, help='Directory to save the output file')
|
||||
parser.add_argument('--create-settings', action='store_true', help='Create default .repo-to-text-settings.yaml file') # Новый аргумент
|
||||
|
|
@ -266,7 +267,7 @@ def main():
|
|||
create_default_settings_file()
|
||||
logging.debug('.repo-to-text-settings.yaml file created')
|
||||
else:
|
||||
save_repo_to_text(output_dir=args.output_dir)
|
||||
save_repo_to_text(path=args.input_dir, output_dir=args.output_dir) # Pf5b7
|
||||
|
||||
logging.debug('repo-to-text script finished')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue