abiosoft / abiosoft/ishell

Run command automatically on startup

Đang mở
#134 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
1.8k
Fork
213
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I am trying to make a CLI app that works similarly to npm. I am using cobra to register the individual commands, and on certain commands, I want to launch an interactive shell with ishell and run a specific command on startup of the shell.

**EDIT:** If not a startup command, is there a way to programatically run commands?

Example:
Say `npm` is my CLI app and `init` is the command that fires up an ishell instance.

The above is implemented with cobra but my understanding is cobra cannot use standard input, hence the use of ishell.

But upon typing `npm init`, I don't want to run another command in the shell, but automatically prompt for standard input. This can be done by having ishell run a command as soon as `shell.Run()` is called. Is this possible?

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.