View Issue Details

IDProjectCategoryView StatusLast Update
0002571OpenFOAMBugpublic2017-06-26 13:04
Reportertomc Assigned Tochris  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Versiondev 
Summary0002571: in foam-dev (20170605) using [TAB] in foamMonitor creates a syntax error on folder name ".../residuals(p,k)"
Descriptionexample of folder location:
/postProcessing/residuals(p,k)/0/residuals.dat

when using the command ls and finish typing with [TAB] I can make automatically;
ls postProcessing/residuals\(p\,k\)/0/residuals.dat

when using the same typing in the command foamMonitor -l, I have;
foamMonitor -l postProcessing/residuals(p,k)
and later the [TAB] can't finish anymore due to the syntax error on "residuals(p,k)".
Steps To Reproducesee above

It is only reproducible in the latest version of foam-dev
TagsNo tags attached.

Activities

wyldckat

2017-06-25 15:43

updater  

proposition_v1.patch (30 bytes)   
etc/config.sh/bash_completion
proposition_v1.patch (30 bytes)   

wyldckat

2017-06-25 15:44

updater  

proposition_v1-2.patch (421 bytes)   
diff --git a/etc/config.sh/bash_completion b/etc/config.sh/bash_completion
index d52281e..af7d01b 100644
--- a/etc/config.sh/bash_completion
+++ b/etc/config.sh/bash_completion
@@ -5792,7 +5792,7 @@ _foamMonitor_ ()
     esac
     COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
 }
-complete -o nospace -F _foamMonitor_ foamMonitor
+complete -o filenames -o nospace -F _foamMonitor_ foamMonitor
 
 _foamNew_ ()
 {
proposition_v1-2.patch (421 bytes)   

wyldckat

2017-06-25 15:45

updater  

proposition_v1.tar.gz (9,598 bytes)

wyldckat

2017-06-25 15:50

updater   ~0008248

@chris: Attached are the following files for fixing this issue:

 - proposition_v1-2.patch - this is the patch file for easier inspection of the change. Essentially the option "-o filenames" will solve this issue in a portable way.

 - proposition_v1.tar.gz - this file provides a replacement file for "etc/config.sh/bash_completion" with this fix.


We could use the function "_filedir" to handle the filtering, but it's not portable to all Linux Distributions, e.g. CentOS 6.

I did not add this option to other entries either, because I couldn't spot any other utilities/scripts that could make good use of this option.



By the way, the report #2590 - https://bugs.openfoam.org/view.php?id=2590 - also somewhat affects the file "etc/config.sh/bash_completion", i.e. "_foamDebugSwitches_" should be removed from this file.

chris

2017-06-26 11:51

manager   ~0008260

"-o filenames" works well for foamCloneCase. I don't think it causes problems with other commands, so we could also include it by default. Is that OK @wyldckat @tomc ?

wyldckat

2017-06-26 12:18

updater   ~0008263

@chris: I guess it's worth a try.

The only thing that comes to mind is for the cases that time folders with negative time values, such as the ones that use "engineFoam", where the auto-complete might switch to '\-180' automatically for whatever reason... but I haven't tested that hypothesis yet.

chris

2017-06-26 13:04

manager   ~0008264

Resolved by commit https://github.com/OpenFOAM/OpenFOAM-dev/commit/4cb47940e0501883310a056e22b1e0428a61ea9b

Issue History

Date Modified Username Field Change
2017-06-06 10:43 tomc New Issue
2017-06-25 15:43 wyldckat File Added: proposition_v1.patch
2017-06-25 15:44 wyldckat File Added: proposition_v1-2.patch
2017-06-25 15:45 wyldckat File Added: proposition_v1.tar.gz
2017-06-25 15:45 wyldckat Assigned To => chris
2017-06-25 15:45 wyldckat Status new => assigned
2017-06-25 15:50 wyldckat Note Added: 0008248
2017-06-26 11:51 chris Note Added: 0008260
2017-06-26 12:18 wyldckat Note Added: 0008263
2017-06-26 13:04 chris Status assigned => closed
2017-06-26 13:04 chris Resolution open => fixed
2017-06-26 13:04 chris Note Added: 0008264