onepub-dev / dcli

An extensive library and tooling for building console/cli applications and scripts using the Dart programming language.
242 stars 28 forks source link

Dcli with Fish Shell #122

Closed lohanidamodar closed 3 years ago

lohanidamodar commented 3 years ago

Is your feature request related to a problem? Please describe. Unable to use dcli with fish shell. I receive following error when i run dcli create hello.dart

Setting flag: verbose
DCli Version: 0.39.3
Found command Instance of 'CreateCommand'
env:  SHELL:/usr/bin/fish
env:  SHELL:/usr/bin/fish
UnimplementedError: UnimplementedError 
Stacktrace: unknown_shell.dart : UnknownShell.isSudo : 144
create.dart : CreateCommand.run : 30
command_line_runner.dart : CommandLineRunner.process : 86
entry_point.dart : EntryPoint._parseCmdLine : 37
entry_point.dart : EntryPoint.process : 31
dcli.dart : DCli.run : 11
dcli.dart : main : 6
isolate_patch.dart : _startIsolate.<anonymous closure> : 299
isolate_patch.dart : _RawReceivePortImpl._handleMessage : 168

Describe the solution you'd like Looks like the fish shell is unimplemented. How can we implement fish shell

shalva97 commented 3 years ago

same error on my Arch Linux KDE

bsutton commented 3 years ago

TIL there is shell called fish:)

Adding shell support is fairly easy.

I would start by copying an existing shell library such as lib/src/shell/zsh_shell.dart renaming it fish_shell.dart

Make any changes to fish_shell that are required.

Then add it to the list of supported shells in shell_detect.dart.

The library bash_shell support tab completion in conjunction with bin/dcli_complete.dart. bash is the only shell that supports tab completion at this point. You can safely ignore this as its a nice to have or have a crack at doing it for fish.

Submit a PR.

lohanidamodar commented 3 years ago

@bsutton Fish doesn't have startScript (like .zshrc or .bashrc) it uses fish config file, what do I do there?

bsutton commented 3 years ago

This is used by your installer to insert path statements.

I will have a look at modifying the API to make it more flexible.

On Fri, 25 Dec 2020, 10:00 am Damodar Lohani, notifications@github.com wrote:

@bsutton https://github.com/bsutton Fish doesn't have startScript (like .zshrc or .bashrc) it uses fish config file, what do I do there?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bsutton/dcli/issues/122#issuecomment-751127627, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG32ODZDDREEOKSFJDWV2TSWPBYDANCNFSM4VIEERCA .

bsutton commented 3 years ago

I've provided some doco on implementing a shell for dcli. https://bsutton.gitbook.io/dcli/contributing/implemention-support-for-a-shell