Make line numbers the default behavior for gpt-copy#23
Conversation
Co-authored-by: simone-viozzi <19674168+simone-viozzi@users.noreply.github.com>
src/gpt_copy/gpt_copy.py
Outdated
| @@ -502,17 +502,26 @@ def write_output( | |||
| @click.option( | |||
There was a problem hiding this comment.
Removed the -n flag completely as requested. Line numbers are now enabled by default with only --no-number to disable them when needed. This simplifies the interface since the -n flag was redundant. (ae95b81)
Co-authored-by: simone-viozzi <19674168+simone-viozzi@users.noreply.github.com>
readme.md
Outdated
| gpt-copy /path/to/directory --no-number | ||
| ``` | ||
|
|
||
| **Explicitly enable line numbers (redundant, but supported for backward compatibility):** |
There was a problem hiding this comment.
this is not present anymore
There was a problem hiding this comment.
Removed the redundant -n flag documentation section. (f59c4fb)
| **Disable line numbers:** | ||
| ```sh | ||
| gpt-copy /path/to/directory --no-number | ||
| ``` |
There was a problem hiding this comment.
since line numbers are enabled by default, word it differently,
do an example to disable the line numers, and do not mention how to enable them, since they are already enabled
There was a problem hiding this comment.
Updated the documentation to focus only on disabling line numbers since they're now enabled by default. Removed the section about enabling them explicitly. (f59c4fb)
src/gpt_copy/gpt_copy.py
Outdated
| no_line_numbers (bool): If True, disable line numbers. | ||
| """ | ||
| # Line numbers are enabled by default, --no-number disables them | ||
| use_line_numbers = not no_line_numbers |
There was a problem hiding this comment.
move it to line 544 and remove comment
There was a problem hiding this comment.
Moved the line numbers logic inline and removed the comment as requested. (f59c4fb)
…e numbers logic inline Co-authored-by: simone-viozzi <19674168+simone-viozzi@users.noreply.github.com>
|
LGTM you can merge the PR |
This PR makes line numbers enabled by default for
gpt-copy, as requested in the issue. Line numbers are useful for referencing specific parts of files when working with LLMs, so they should be on by default.Changes Made
Core Functionality
--no-numberflag to disable line numbers when needed-n/--numberflag for backward compatibility--no-numbertakes precedence over-nif both are specifiedBefore vs After
Before (line numbers off by default):
After (line numbers on by default):
Documentation Updates
Testing
Example Output
With line numbers now enabled by default: