Skip to content

Commit

Permalink
fix: Fixed CLI option names.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Sep 8, 2024
1 parent bd9668a commit 6c53246
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
6 changes: 4 additions & 2 deletions src/libs/Firecrawl.Cli/Commands/AuthCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ namespace Firecrawl.Cli.Commands;

public class AuthCommand : Command
{
public AuthCommand() : base(name: "auth", description: "Authenticates with API key")
public AuthCommand() : base(
name: "auth",
description: "Authenticates with API key")
{
var apiKeyOption = new Argument<string>(
name: "apiKey",
name: "api-key",
getDefaultValue: () => string.Empty,
description: "API key");
AddArgument(apiKeyOption);
Expand Down
10 changes: 6 additions & 4 deletions src/libs/Firecrawl.Cli/Commands/CrawlCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ namespace Firecrawl.Cli.Commands;

public class CrawlCommand : Command
{
public CrawlCommand() : base(name: "crawl", description: "Crawl a url and saves all pages as markdown")
public CrawlCommand() : base(
name: "crawl",
description: "Crawl a url and saves all pages as markdown")
{
var url = new Argument<string>(
name: "url",
Expand All @@ -13,19 +15,19 @@ public CrawlCommand() : base(name: "crawl", description: "Crawl a url and saves
AddArgument(url);

var outputPath = new Option<string>(
name: "outputPath",
aliases: ["--output", "-o"],
getDefaultValue: () => string.Empty,
description: "Output path");
AddOption(outputPath);

var limit = new Option<int>(
name: "limit",
aliases: ["--limit", "-l"],
getDefaultValue: () => 5,
description: "Limit of pages to crawl");
AddOption(limit);

var maxDepth = new Option<int?>(
name: "maxDepth",
aliases: ["--max-depth", "-d"],
getDefaultValue: () => null,
description: "Maximum depth to crawl relative to the entered URL. A maxDepth of 0 scrapes only the entered URL. A maxDepth of 1 scrapes the entered URL and all pages one level deep. A maxDepth of 2 scrapes the entered URL and all pages up to two levels deep. Higher values follow the same pattern.");
AddOption(maxDepth);
Expand Down
6 changes: 4 additions & 2 deletions src/libs/Firecrawl.Cli/Commands/MapCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ namespace Firecrawl.Cli.Commands;

public class MapCommand : Command
{
public MapCommand() : base(name: "map", description: "Attempts to output all website's urls in a few seconds.")
public MapCommand() : base(
name: "map",
description: "Attempts to output all website's urls in a few seconds.")
{
var url = new Argument<string>(
name: "url",
Expand All @@ -13,7 +15,7 @@ public MapCommand() : base(name: "map", description: "Attempts to output all web
AddArgument(url);

var outputPath = new Option<string>(
name: "outputPath",
aliases: ["--output", "-o"],
getDefaultValue: () => string.Empty,
description: "Output path");
AddOption(outputPath);
Expand Down
6 changes: 4 additions & 2 deletions src/libs/Firecrawl.Cli/Commands/ScrapeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ namespace Firecrawl.Cli.Commands;

public class ScrapeCommand : Command
{
public ScrapeCommand() : base(name: "scrape", description: "Scrapes page and saves it as markdown")
public ScrapeCommand() : base(
name: "scrape",
description: "Scrapes page and saves it as markdown")
{
var url = new Argument<string>(
name: "url",
Expand All @@ -13,7 +15,7 @@ public ScrapeCommand() : base(name: "scrape", description: "Scrapes page and sav
AddArgument(url);

var outputPath = new Option<string>(
name: "outputPath",
aliases: ["--output", "-o"],
getDefaultValue: () => "output.md",
description: "Output path");
AddOption(outputPath);
Expand Down

0 comments on commit 6c53246

Please sign in to comment.