GithubHelp home page GithubHelp logo

Comments (4)

fmuellner avatar fmuellner commented on July 28, 2024

I want to paste something into the cli like lab mr b <paste>

A simple paste won't work, because without escaping, both # and ! are interpreted by the shell before the argument reaches lab.

I'm not sure how much of a showstopper that is - on the one hand, adding quotes or \ still seems easier than stripping the prefix, on the other hand it can be a bit confusing if you aren't aware of the issue:

$ lab issue show #123
2022/04/08 01:01:48 ERROR: issue_show.go:35: Specify <id> of issue to be show

from lab.

claytonrcarter avatar claytonrcarter commented on July 28, 2024

Oh, of course. I hadn't thought of that! Good call.

This sent me down a bit of a rabbit hole, though. It looks like different shells handle these differently: bash won't natively pass #100 or !100, zsh will pass #100 but not !100, and fish (my shell, fwiw) will not pass #100 but will pass !100. (I tried these out w/ echo #100 and echo !100; maybe there's something else I'm missing, though.)

In general, double-click on macOS will select just the digits w/o the prefix, so I can easily copy/paste a single MR/issue id w/o the prefix. The specific use case that spurred me to open the issue was copying a preexisting list of MRs in !123 !456 !789 format and I wanted to grep some info out of mr show for each of them. I used for mr in <paste>; mr show $mr | grep ... ; end but had to manually strip the ! for each. (Oh, the chore!) Something like pbpaste | xargs -n 1 lab mr b {} comes to mind as well to be able to open a new tab for each MR in a list; I think that xargs would skip the shell interpretation.

Anyway, just more fodder for discussion. Thanks for considering!

from lab.

claytonrcarter avatar claytonrcarter commented on July 28, 2024

Tinkering tinkering ... I played w/ this and it seems like strings.TrimLeft(args[1], "#!") was enough to make it work. So even if it's not useful for the project ... it's easy enough for me to keep it patched locally. 😄

from lab.

fmuellner avatar fmuellner commented on July 28, 2024

Thanks for considering!

Oh, it's not up to me to consider the issue, I was only commenting from the sidelines 😂 (while being sympathetic to the suggestion)

from lab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.