I think such an error is incorrect since "dfs -ls <PATH>" (without explain) would never throw such an error on it's own (and execution of "dfs..." doesn't go to semantic analysis), so I see no reason for explain of "dfs...." to go to semantic analysis and throw semantic analysis type error.
Furthermore having check for incorrect explains at the beginning saves a lot of time, otherwise all the analysis and various class instances would be need to be created only to find error that we can easily see from the very beginning. And if someone would like to add or remove a command that doesn't go to Driver to be compiled, he will need to add or remove an "if" in CliDriver anyway so it shouldn't be hard for him to notice that he also needs to update that list. Finally if that suggestion of fix will pass I can add appropriate tests, checking if explains errors of non-sematic-analisys commands are informative, so it will be easier to see if something is wrong after subsequent changes.
The bad thing is that after this change, even for valid explain query we will check "contains" on that list, but fortunately since it is short it doesn't cost too much time.