greg-js / arch-wiki-man

Search a local, updated copy of the entire Arch Wiki and open the article in `man`
GNU General Public License v3.0
141 stars 2 forks source link

Multiple Select prompts when searching for Python #2

Closed donniebishop closed 8 years ago

donniebishop commented 8 years ago

When searching for "python" and scrolling through the multiple results, awman will prepend another line to the beginning of the search results to "Select the Arch Wiki article".

~ $ awman python
? Select the Arch Wiki article (Use arrow keys)
❯ [1/5] Python package guidelines: This document covers standards and guidelines on writing
? Select the Arch Wiki article 
  [1/5] Python package guidelines: This document covers standards and guidelines on writing
? Select the Arch Wiki article 
  [1/5] Python package guidelines: This document covers standards and guidelines on writing
? Select the Arch Wiki article 
  [1/5] Python package guidelines: This document covers standards and guidelines on writing
? Select the Arch Wiki article 
  [1/5] Python package guidelines: This document covers standards and guidelines on writing
 PKGBUILDs for Python software. 
  [2/5] Python-Virtualenv: virtualenv is a Python tool written by Ian Bicking and used to c
reate isolated environments for Python in which you can install packages without ... 
❯ [3/5] Python: Python is a widely used general-purpose, high-level programming language. I
ts design philosophy emphasizes code readability, and its syntax allow... 
  [4/5] Python (한국어): 파이썬(Python)은 1991년 프로그래머인 귀도 반 로섬(Guido van Rossum) 이 발표한 고급 프로그래밍 언어
로, 플랫폼 독립적이며 인터프리터식, 객체지향적, 동적 타이핑(dynamically typed) 대화형 언어이다. 파이썬이라는 이름은 귀... 
  [5/5] mod_python: Mod_python is an Apache module that embeds the Python interpreter withi
n the server. With mod_python you can write web-based applications in Pyth... 

This seems to work fine when searching other general terms and getting back multiple responses, such as "install":

~ $ awman install
? Select the Arch Wiki article 
  [6/17] Migrating Between Architectures Without Reinstalling: This page documents two pote
ntial methods of migrating installed systems between i686 (32-bit) and x86_64 (64-bit) arch
itectures, in either direc... 
  [7/17] Migrate installation to new hardware: This article discusses the steps required fo
r moving an Arch Linux system to new hardware. The goal is to achieve the same ArchLinux in
stallation... 
  [8/17] Install bundled 32-bit system in 64-bit system: This article presents one way of r
unning 32-bit applications, which may be of use to those who do not wish to install the lib
32-* libraries from ... 
❯ [9/17] Moving an existing install into (or out of) a virtual machine: This article descri
bes how to transfer your current Arch Linux installation in or out of a virtual environment
 (i.e. QEMU, VirtualBox, VMware), a... 
  [10/17] Install from SSH: This article is intended to show users how to install Arch remo
tely via an SSH connection. Consider this approach over the standard one in scenar... 
  [11/17] Installing VMWare vCLI: The vCLI utilities make it possible to manage VMWare ESX 
servers (with the possibility of using vCenter). Eventhough Archlinux is not one of the ...

  [12/17] Installation guide: This document is a guide for installing Arch Linux from the l
ive system booted with the official installation image. Before installing, it would ... 
(Move up and down to reveal more choices)

I don't have any experience in debugging, but if I had to guess, maybe it's the way that the result in Korean is being handled by the program? I can't think of another thing to search up that would return a result specifically in Korean, but it's a thought.

greg-js commented 8 years ago

Hi, thanks for the report. You are correct, it does this for not only Korean, but Chinese results too. I'll be pushing out a new version with foreign language support later today and then it at least won't happen on regular (default english) searches anymore. I'll debug the non-Latin character issue afterwards. Thanks again for the heads up!

greg-js commented 8 years ago

It seems that there was an issue with the inquirer library. It should be fixed now. Can you update, test and confirm?

I haven't updated the readme yet, but I pushed the multi-language support feature so you won't actually find any Chinese or Korean results in a default (English) search anymore. To get those results, run awman with the -l korean option (or chinesesim or chinesetrad)

donniebishop commented 8 years ago

Awesome! Great turnaround time. 

Away from my VM at the moment, but will test tonight once I get into work.

On Mon, Feb 15, 2016 at 1:17 PM, greg-js notifications@github.com wrote:

It seems that there was an issue with the inquirer library. It should be fixed now. Can you update, test and confirm?

I haven't updated the readme yet, but I pushed the multi-language support feature so you won't actually find any Chinese or Korean results in a default (English) search anymore. To get those results, run awman with the -l korean option (or chinesesim or chinesetrad)

Reply to this email directly or view it on GitHub: https://github.com/greg-js/arch-wiki-man/issues/2#issuecomment-184333198

donniebishop commented 8 years ago

Sorry about the wait, but I have confirmed that it's working properly now. Thanks again for the quick response!

greg-js commented 8 years ago

Whoops! For what it's worth, there was another bug in the menu formatting causing some entries to mysteriously lose the first [ bracket. Turns out I'd misplaced a parenthesis somewhere! I'll push the fix later today but thanks again for the bug report, it's brought several things to light already :)