Comments (4)
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.
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.
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.
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)
- mr create: accept default MR description HOT 8
- hierarchical config places
- BINDIR should default to /usr/local/bin/ not to /usr/bin
- lab mr create crashes when assigning to unknown usernames HOT 4
- `lab mr merge` does not respect delete source branch HOT 3
- lab 0.24.0, 0.25.0 failed due to `ls-files` not exist HOT 2
- Increase Issue creation HOT 4
- create command to handle approval rules
- `lab mr create` from local branch HOT 4
- project list --all command option does not return all the projects anymore HOT 1
- lab issue create mr HOT 4
- provide an easy way to check if MR already exists for the current branch
- ci view --follow panics HOT 1
- Don't write token to ~/.config/lab/lab.toml if environment is used HOT 4
- Suggest to create the remote `origin` by default HOT 1
- support browsing to project file
- support managing "epics"
- Use Authorization Bearer header instead of PAT on demand HOT 2
- Allow generating the config file through CLI params HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lab.