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

feat(linkli): add spec #2495

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AdamJNavarro
Copy link

Add initial spec for linkli cli

@withfig-bot
Copy link
Collaborator

withfig-bot commented Nov 1, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@withfig-bot
Copy link
Collaborator

Overview

src/linkli.ts:

Info:

Single Functions:

postProcess:

 function (out, tokens) {
    const entered_names = tokens.slice(2, -1);

    const split_out = out.split("\n");
    if (split_out.length === 1) {
      const names = split_out[0].split(",");
      const filtered_names = names.filter(
        (name) => entered_names.indexOf(name) === -1
      );
      const suggestions = filtered_names.map((name) => ({
        name,
      }));
      return suggestions;
    }
    const priority_names = split_out[0].split(",");
    const priority_suggestions = priority_names.map((name) => ({
      name,
      priority: 80,
    }));

    const remaining_names = split_out[1].split(",");
    const remaining_suggestions = remaining_names.map((name) => ({
      name,
    }));

    const combined_suggestions = [
      ...priority_suggestions,
      ...remaining_suggestions,
    ];

    const filtered_suggestions = combined_suggestions.filter(
      (suggestion) => entered_names.indexOf(suggestion.name) === -1
    );

    return filtered_suggestions;
  }

@withfig-bot
Copy link
Collaborator

Hello @AdamJNavarro,
thank you very much for creating a Pull Request!
Here is a small checklist to get this PR merged as quickly as possible:

  • Do all subcommands / options which take arguments include the args property (args: {})?
  • Are all options modular? E.g. -a -u -x instead of -aux
  • Have all other checks passed?

Please add a 👍 as a reaction to this comment to show that you read this.

@AdamJNavarro
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

withfig-bot added a commit that referenced this pull request Nov 1, 2024
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.

2 participants