Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cli/src/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ pub fn create_code(cli: &CLI, code_config: Code) -> anyhow::Result<Content> {
let parsed_code_snippet = parsed_range.cut_code_snippet(&code_snippet)?;
let mut code = CodeBuilder::default()
.content(parsed_code_snippet)
.start_line_number(parsed_range.0 as u32)
.build()?;

code.start_line_number = cli
.has_line_number
.then_some(cli.start_line_number.unwrap_or(parsed_range.0 as u32));

code.file_path = cli
.from_file
.clone()
Expand Down
2 changes: 1 addition & 1 deletion cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct CLI {

/// Breadcrumbs is a useful and unique feature in CodeSnap, it shows the path of the file
/// so that users can know where the code snippet comes from.
#[arg(long)]
#[arg(long, default_value = "false")]
has_breadcrumbs: Option<bool>,

#[arg(long, default_value = "false")]
Expand Down