Closed callmekohei closed 6 years ago
The correct way to do this is in the MyCommand
constructor, like here for ThreadCommand
for example: https://github.com/mono/sdb/blob/master/src/Commands/ThreadCommand.cs#L267
Hello again! I'm callmekohei
!
So may I have question?
I write code following:
namespace Mono.Debugger.Client.Commands
[<Sealed; Command>]
type HelloWorld() =
inherit Command()
override __.Names = [|"bbbCmd"|]
override __.Summary = "aaa bbb ccc"
override __.Syntax = "ddd eee fff"
override __.Help = "Help Help Help"
override __.Process(args) =
Log.Info("hello world from bbbCmd")
[<Sealed; Command>]
type MyCommand() =
inherit MultiCommand()
override this.Names = [|"aaaCmd"|]
override this.Summary = "aaaaaaaaaaa"
override this.Syntax = "bbbbbbbbbbb"
override this.Help = "ccccccccccc"
member public this.MyCommand() =
this.AddCommand<HelloWorld>()
this.Forward<HelloWorld>()
Log.Info("hello world")
result
(sdb) help
aaaCmd
aaaaaaaaaaa
(sdb) help aaaCmd
bbbbbbbbbbb
ccccccccccc
(sdb) aaaCmd
No 'aaaCmd' sub-command specified <---- wooops! (^_^;;;
Please tell me anything if you have nice idea!
So sorry for F# code
instead of C#
code. (^_^;;
Hello again! I'm callmekohei
!
So, I can just do it !
Thank you for your advice!
like this
namespace Mono.Debugger.Client.Commands
open Mono.Debugger.Client
open Mono.Debugging.Client
type helloworld() =
inherit command()
override __.names = [|"bbbcmd"|]
override __.summary = "aaa bbb ccc"
override __.syntax = "ddd eee fff"
override __.help = "help help help"
override __.process(args) =
log.info("hello world from bbbcmd")
[<Sealed; Command>]
type MyCommand() =
inherit MultiCommand()
do base.AddCommand<HelloWorld>()
override this.Names = [|"aaaCmd"|]
override this.Summary = "aaaaaaaaaaa"
override this.Syntax = "bbbbbbbbbbb"
override this.Help = "ccccccccccc"
And thank you for Japanese F#ers!
Hello! I'm
callmekohei
!Problem
I can not use
addCommand
.Expected behavior
I can use
addCommand
Like this
work around
(sdb) do , step over , mycmd
reason
Take time to input when we use sdb on command-line.
Flickering screen
like this