How do you pass arguments from command line to main in Flutter/Dart?

There is no way to do that, because when you start an app on your device there are also no parameters that are passed. If this is for development, you can pass -t lib/my_alternate_main.dart to flutter run to easily switch between different settings where each alternate entry-point file calls the same application code with different … Read more

How to list specific type of files in recursive directories in shell?

If you are more confortable with “ls” and “grep”, you can do what you want using a regular expression in the grep command (the ending ‘$’ character indicates that .doc must be at the end of the line. That will exclude “file.doc.txt”): ls -R |grep “\.doc$” More information about using grep with regular expressions in … Read more

Difference between Delegatecommand, relaycommand and routedcommand

Your FindProductCommand class implements the ICommand interface, which means it can be used as a WPF command. It is neither a DelegateCommand nor a RelayCommand, nor is it a RoutedCommand, which are other implementations of the ICommand interface. FindProductCommand vs DelegateCommand/RelayCommand Generally, when an implementation of ICommand is named DelegateCommand or RelayCommand, the intention is … Read more

Get a file from CLI input

A great option is the fileinput module, which will grab any or all filenames from the command line, and give the specified files’ contents to your script as though they were one big file. import fileinput for line in fileinput.input(): process(line) More information here.

Quick ls command

ls -U will do the ls without sorting. Another source of slowness is –color. On some linux machines, there is a convenience alias which adds –color=auto’ to the ls call, making it look up file attributes for each file found (slow), to color the display. This can be avoided by ls -U –color=never or \ls … Read more

How to redirect ex command output into current buffer or file?

:redir >name_of_registers_file :registers :redir END :r name_of_registers_file :help redir The last command is very useful, since there are lots of options for redirection: to variables, to registers, how to append, further cornucopia. I still find it weird and annoying that it uses END that way, but since everything else that can follow redir has to … Read more